
import java.io.*;
import java.util.*;

/**
 * 
 */
public static void main(String[] args) {

    /**
     * Default constructor
     */
        System.out.println("Starts Factory Method mode!");
    // 使用海尔电视工厂
        AbstractTVFactory haierFactory = new HaierTVFactory();
        TV haierTV = haierFactory.produceTV();
        haierTV.display();
        /*   输出：
     The TV factory is producing Haier televisions!
     Haier TV is displaying!*/

    // 使用海信电视工厂
        AbstractTVFactory hisenseFactory = new HisenseTVFactory();
        TV hisenseTV = hisenseFactory.produceTV();
        hisenseTV.display();
        /*   输出：
     The TV factory is producing Hisense televisions!
     Hisense TV is displaying!*/

        //生产TCL电视机,只需要对应增加一个新的TCL工厂,原有的工厂无须做任何修改
        AbstractTVFactory tclFactory = new TCLTVFactory();
        TV tclTV = tclFactory.produceTV();
        tclTV.display();
        /*   输出：
     The TV factory is producing TCL televisions!
     TCL TV is displaying!*/
}